package io.geekidea.boot.chargeback.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@ToString(callSuper = true)
@ColumnWidth(value = 15)
public class ChargeBackExcel implements Serializable {

    @Serial
    private static final long serialVersionUID = -7919600702231015944L;

    @Schema(description = "退单号")
    @TableField("numbers")
    @ExcelProperty("退单号")
    private String numbers;

    @Schema(description = "订单号")
    @ExcelProperty("订单号")
    @TableField("orderId")
    private String orderId;

    @Schema(description = "订单类型")
    @TableField("order_types")
    @ExcelProperty("订单类型")
    private String orderTypes;

    @Schema(description = "订单金额")
    @TableField("order_amount")
    @ExcelProperty("订单金额")
    private Double orderAmount;

    @Schema(description = "退款金额")
    @TableField("refundAmount")
    @ExcelProperty("退款金额")
    private Double refundAmount;


    @Schema(description = "战区")
    @TableField("areaId")
    @ExcelProperty("战区名称")
    private Integer areaId;

    @Schema(description = "门店id")
    @TableField("storeId")
    @ExcelProperty("门店名称")
    private Integer storeId;


    @Schema(description = "制单人")
    @TableField("prepared_by")
    @ExcelProperty("制单人")
    private String preparedBy;

    @Schema(description = "审核人")
    @TableField("auditor")
    @ExcelProperty("审核人")
    private String auditor;

    @Schema(description = "制单时间")
    @TableField("createdTime")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    @ExcelProperty("制单时间")
    @DateTimeFormat("yyyy-MM-dd")
    private LocalDateTime createdTime;


    @Schema(description = "审核时间")
    @TableField("updatedTime")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    @ExcelProperty("审核时间")
    @DateTimeFormat("yyyy-MM-dd")
    private LocalDateTime updatedTime;

    @Schema(description = "退款原因")
    @TableField("reasons_for_refund")
    @ExcelProperty("退款原因")
    private String reasonsForRefund;
}
